package com.lyx.bank.mq;

import com.lyx.bank.service.RecordsService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Date;
import java.util.Map;

/**
 * @ClassName Receiver
 * @Description: TODO
 * @Author 86152
 * @Date 2022/4/27
 * @Version V1.0
 **/
@Slf4j
@Component
public class Receiver {

    @Autowired
    RecordsService recordsService;

    @RabbitListener(queues = "bank.queue1")
    public void receiveD(Map<String,Object> map) throws IOException {
       recordsService.createdRecords(map);
        log.info("当前时间：{},收到死信队列信息{}", new Date().toString());

    }
}
